#pragma once
#include "KinectMsg.h"
#include <XnOpenNI.h>
#include "Kinect.h"

static const int MAX_DEPTH = 10000;

class SceneDrawer
{
private:
	static const int GL_WIN_SIZE_X = 720;
	static const int GL_WIN_SIZE_Y = 480;
	static XnBool g_bPause ;
	static XnBool g_bRecord ;
	static XnBool g_bQuit;
	static XnBool g_bNeedPose ;
	static XnChar g_strPose[20];
	static XnBool g_bDrawBackground;
	static XnBool g_bDrawPixels;
	static XnBool g_bDrawSkeleton;
	static XnBool g_bPrintID;
	static XnBool g_bPrintState; 
	static float g_pDepthHist[MAX_DEPTH];
	static float texcoords[8];
	static XnFloat Colors[][3];
	static XnUInt32 nColors;
public:
	static KinectMsg msg;
	static bool bNewMsg;
public:
	static int glMain(int arg, char **argv);
private:
	SceneDrawer(void);
	~SceneDrawer(void);
	static void glInit(int  *argc, char ** argv);
	static void glutKeyboard (unsigned char key, int x, int y);
	static void CleanupExit();
	static void glutDisplay (void);
	static void glutIdle (void); 
	static void DrawDepthMap();
	static unsigned int getClosestPowerOfTwo(unsigned int n);
	static unsigned int initTexture(void** buf, int& width, int& height);
	static void DrawRectangle(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY);
	static void DrawTexture(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY);
	static void glPrintString(void *font, char *str);
};



